#!/usr/bin/perl -w
#===============================================================================
#
#         FILE:  Fiel_Continuity_check.pl
#
#        USAGE:  Fiel_Continuity_check.pl 
#
#  DESCRIPTION:  
#
#      OPTIONS:  ---
# REQUIREMENTS:  ---
#         BUGS:  ---
#        NOTES:  ---
#       AUTHOR:  ZHOU LEI , <networklei@gmail.com>
#      COMPANY:  ultrapower
#      VERSION:  1.0
#      CREATED:  09/15/2009 23:21:06 PM CST
#     REVISION:  LEI
#===============================================================================
use Time::Local;


$DIR = "/home/lester/Perl/Test";

chdir $DIR;

@list=`ls | grep CF`;

$name = shift (@list);

$name=~/CF(\d\d\d\d)\.DAT/;

$id = $1;$id++;

$error = 0;

foreach (@list){
   if ( /CF$id\.DAT/){
   	$id++;
   }else{
   	print "File is not continuous,missing CF$id\.DAT file\n";
   	$error++;
   	$id+=2;
   }
}
if ($error == 0){
	print "File continuity check through the\n"
}else{
	print"missing $error file\n";
}

